package com.itrident.dialog;

import com.intellij.application.options.editor.GutterIconsConfigurable;
import com.intellij.icons.AllIcons;
import com.intellij.ide.IconUtilEx;
import com.intellij.openapi.actionSystem.ActionManager;
import com.intellij.openapi.actionSystem.ActionToolbar;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.DefaultActionGroup;
import com.intellij.openapi.actionSystem.impl.ActionButton;
import com.intellij.openapi.actionSystem.impl.ActionToolbarImpl;
import com.intellij.openapi.fileEditor.impl.EditorTabbedContainer;
import com.intellij.openapi.fileEditor.impl.EditorWindow;
import com.intellij.openapi.fileEditor.impl.EditorWindowHolder;
import com.intellij.ui.IconManager;
import com.intellij.ui.components.JBPanel;
import com.intellij.ui.components.JBTabbedPane;
import com.intellij.ui.components.panels.NonOpaquePanel;
import com.intellij.util.IconUtil;
import com.intellij.util.ui.UIUtil;

import javax.swing.*;
import javax.swing.plaf.IconUIResource;
import java.awt.*;

/**
 * @author cxx
 * @create 2021-05-10 14:11
 **/
public class Dere {
    private JPanel panel1;
    private JTextField textField1;
    private JTabbedPane tabbedPane1;
    private JPanel toolBarPanel;

    private AnAction action;

    public Dere(AnAction action) {
        this.action = action;
    }

    private void createUIComponents() {
        panel1 = new JBPanel ();
        tabbedPane1 = new JBTabbedPane ();
        ActionManager actionManager = ActionManager.getInstance ();
        ActionToolbarImpl actionToolbar = (ActionToolbarImpl) actionManager.createActionToolbar ("Dere View", (DefaultActionGroup) actionManager.getAction ("Dere.ActionsToolbar"), true);
        actionToolbar.setTargetComponent (panel1);
        toolBarPanel = actionToolbar;
    }

    {
// GUI initializer generated by IntelliJ IDEA GUI Designer
// >>> IMPORTANT!! <<<
// DO NOT EDIT OR ADD ANY CODE HERE!
        $$$setupUI$$$ ();
    }

    /**
     * Method generated by IntelliJ IDEA GUI Designer
     * >>> IMPORTANT!! <<<
     * DO NOT edit this method OR call it in your code!
     *
     * @noinspection ALL
     */
    private void $$$setupUI$$$() {
        createUIComponents ();
        panel1.setLayout (new BorderLayout (0, 0));
        panel1.add (toolBarPanel, BorderLayout.NORTH);
        final JPanel panel2 = new JPanel ();
        panel2.setLayout (new BorderLayout (0, 0));
        panel1.add (panel2, BorderLayout.CENTER);
        final JPanel panel3 = new JPanel ();
        panel3.setLayout (new BorderLayout (0, 0));
        panel2.add (panel3, BorderLayout.NORTH);
        final JPanel panel4 = new JPanel ();
        panel4.setLayout (new FlowLayout (FlowLayout.CENTER, 5, 5));
        panel3.add (panel4, BorderLayout.CENTER);
        final JLabel label1 = new JLabel ();
        label1.setText ("Label");
        panel4.add (label1);
        textField1 = new JTextField ();
        textField1.setText ("");
        panel4.add (textField1);
        final JPanel panel5 = new JPanel ();
        panel5.setLayout (new BorderLayout (0, 0));
        panel2.add (panel5, BorderLayout.CENTER);
        tabbedPane1 = new JTabbedPane ();
        panel5.add (tabbedPane1, BorderLayout.CENTER);
        final JPanel panel6 = new JPanel ();
        panel6.setLayout (new BorderLayout (0, 0));
        tabbedPane1.addTab ("xxx.java", panel6);
    }

    /**
     * @noinspection ALL
     */
    public JComponent $$$getRootComponent$$$() {
        return panel1;
    }

}
